home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
352_01
/
vldtpath.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-22
|
749b
|
39 lines
/* VLDTPATH.C - contains validate_path()
* general purpos function to validate data paths
* PARM may be either NULL or C:\path\
* specified path must exist and not be empty.
* RETURNS: -1 if not valid, 0 if valid.
*/
#include <stdlib.h>
#include <string.h>
#include <dir.h>
#include "dblib.h"
int validate_path ( char *path )
{
int retcode = 0;
char far *savedta;
struct ffblk ffb;
String *fullnm = make_fullfilename ( path, "*.*" );
savedta = getdta ();
if ( -1 == findfirst ( (*fullnm), &ffb, FA_DIREC ) )
{
errno =0;
retcode = -1;
}
delete fullnm;
setdta (savedta);
return (retcode);
}
/*----------------------- VLDTPATH.CPP -----------------------------*/